<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>日志管理</title>
<link href="/back/css/style.css" rel="stylesheet" type="text/css" />
<link href="/back/css/select.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><a href="/admin/accesslog/query">日志管理</a></li>
		</ul>
	</div>

	<div class="rightinfo">


		<form action="/admin/accesslog/query"  id="from">
			<ul class="seachform">
			    <li><label>用户名</label><input placeholder="输入用户名" value="${map.userName!''}" name="userName" type="text" class="scinput" /></li>
			    <li><label>角色</label>
			    	<div class="vocation">
					    <select class="select1" id="roleId" name="roleId">
					   		<option value="0">全部</option>
					   		<#list roleList as role>
						   		<#if map.roleId?? && (role.id?c) == (map.roleId!'')>
						   			<option value="${role.id?c}" selected="selected">${role.name!''}</option>
						   		<#else>
						   			<option value="${role.id?c}" >${role.name!''}</option>
						   		</#if>
					   		</#list>
					    </select>
				    </div>
			    </li>
			    <li><label>角色</label>
			    	日期范围：
					<input type="text" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'logmax\')||\'%y-%M-%d %H:%m:%s\'}',dateFmt:&#39;yyyy-MM-dd HH:mm:ss&#39;})" value="${map.startTime!''}" id="logmin" name="startTime" class="Wdate scinput" style="width:125px;"/>
					-
					<input type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'logmin\')}',dateFmt:&#39;yyyy-MM-dd HH:mm:ss&#39;})" value="${map.lastTime!''}" id="logmax" name="lastTime" class="Wdate scinput" style="width:125px;"/>
			    </li>
			    <li><button type="button" class="scbtn" onclick="formSubmit(this,'from');" value="查询">查询</button></li>
			    <ul class="toolbar">
				    <li onclick="delete_tiaojian()"><span><img src="/back/images/t03.png" /></span>条件删除</li>
				</ul>
		    </ul>
	    </form>
		<form id="accesslogsForm">
		<table class="tablelist">
			<thead>
				<tr>
					<td colspan="8">
						<ul class="toolbar" style="margin-left: 5px;margin-top: 5px;">
						    <li onclick="deleteConfirm('你确定要删除选择的这些数据吗？','accesslogs','/admin/accesslog/delete','accesslogsForm')"><span><img src="/back/images/t03.png" /></span>批量删除</li>
						</ul>
					</td>
				</tr>
				<tr>
					<th><input type="checkbox" onclick="selectAll('accesslogs');"/></th>
					<th>用户名称</th>
					<th>角色</th>
					<th>操作内容</th>
					<th>链接地址</th>
					<th>IP/本机名称</th>
					<th>操作时间</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<#list list as entity >
					<tr>
						<td><input type="checkbox" name="accesslogs" value="${entity.id!''}" /></td>
				        <td>${entity.userName!''}</td>
				        <td>${entity.roleName!''}</td>
				        <td>${entity.handleContent!''}</td>
				        <td>${entity.configKey!''}</td>
				        <td>${entity.clientIpAndName!''}</td>
				        <td>${entity.createTime?string('yyyy-MM-dd HH:mm:ss')}</td>
				        <td>
			 				<a class="tablelink" href="javascript:acc_del(this,'${entity.id!''}');" title="删除">删除</a>
				        </td>
					</tr>
				</#list>
			</tbody>
		</table>
		</form>
		${pageInfo!}
	</div>
	
	<script src="/back/js/jquery.js" language="JavaScript" ></script>
	<script type="text/javascript" src="/back/js/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="/back/js/select-ui.min.js"></script>
	<script type="text/javascript" src="/back/js/base.js"></script>
	<!-- 弹窗js -->
    <script src="/back/js/layer/layer.js"></script>
	<script type="text/javascript">
	$(document).ready(function(e) {
	    $(".select1").uedSelect({
			width : 100			  
		});
	});
	
	/*独立-删除*/
	function acc_del(obj,id){
		layer.confirm('确认要删除吗？',function(index){
			$.post("/admin/accesslog/delete?from=ajax", {'accesslogs': id },
			    function(result) {
			    	jsonState(result);
			    },'json');
		});
	}
	/* 条件删除数据 */
	function delete_tiaojian(){
		layer.confirm('确认要条件删除这些数据吗？',function(index){
			$.post("/admin/accesslog/deletetj?from=ajax",$("#from").serialize(),
			    function(result) {
					jsonState(result);
			    },'json');
		});
	}
	</script>
</body>
</html>
